using System;
using FireStarter.Base;
using FireStarterModeller.BO;
using Habanero.BO;
using Habanero.BO.ClassDefinition;
using Habanero.BO.Loaders;
using NUnit.Framework;

namespace Firestarter.DB_DomainModel.Logic.Test
{
    [TestFixture]
    public class TestBase
    {
        #region Setup/Teardown

        [TestFixtureSetUp]
        public virtual void TestFixtureSetup()
        {
            ClassDef.ClassDefs.Clear();
            ClassDef.ClassDefs.Add(new XmlClassDefsLoader(BOBroker.GetClassDefsXml(), new DtdLoader()).LoadClassDefs());
        }

        // ReSharper disable RedundantNameQualifier
        [SetUp]
        public virtual void SetupTest()
        {
            GC.Collect();
            GC.WaitForPendingFinalizers();
            BORegistry.DataAccessor = new DataAccessorInMemory();
        }

        // ReSharper restore RedundantNameQualifier

        [TearDown]
        public virtual void TearDownTest()
        {
            //ClassDef.ClassDefs.Clear();
        }

        #endregion

    }
}